home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 109
/
Vol 109.iso
/
games
/
free_sty.swf
/
scripts
/
frame_15
/
DoAction.as
Wrap
Text File
|
2008-11-12
|
4KB
|
155 lines
stop();
_root.stopSound();
_root.playSound();
_root.score2 = _root.score;
_root.bg_mc.unloadMovie();
_root.attachMovie("bg" + _root.level,"bg_mc",_root.getNextHighestDepth());
_root.bg_mc.swapDepths(_root.bgbg.getDepth());
_root.timeC = 0;
_root.win = 0;
_root.llevel = 1;
_root.rlevel = 2;
_root.scoretxt = _root.score;
if(_root.debug == 1)
{
_root.showA();
for(var i in _root.zhu_array[_root.level])
{
_root.bg_mc.attachMovie("tt","tt" + i,_root.bg_mc.getNextHighestDepth(),{_x:_root.zhu_array[_root.level][i][0],_y:_root.zhu_array[_root.level][i][1],ii:i});
_root.bg_mc["tt" + i].gotoAndStop(_root.zhu_array[_root.level][i][2]);
}
_root.ttn = _root.zhu_array[_root.level].length;
}
_root.onEnterFrame = function()
{
_root.mxx = _root.bg_mc.man._x;
_root.myy = _root.bg_mc.man._y;
_root.bxx = _root.bg_mc.man._x * _root.bg_mc._xscale / 100 + _root.bg_mc._x;
_root.byy = _root.bg_mc.man._y * _root.bg_mc._yscale / 100 + _root.bg_mc._y;
_root.ff = _root.bg_mc.man._xscale / Math.abs(_root.bg_mc.man._xscale);
if(_root.zt == "walk" || _root.zt == "stand")
{
_root.ationd = 0;
if(Key.isDown(39))
{
_root.xy = _root.getvv(0,_root.rlevel);
_root.bg_mc.man._x += _root.xy.xx;
_root.bg_mc.man._y += _root.xy.yy;
_root.bg_mc.man._xscale = Math.abs(_root.bg_mc.man._xscale);
if(_root.zt != "walk")
{
_root.bg_mc.man.gotoAndPlay("奔跑");
_root.zt = "walk";
}
}
else if(Key.isDown(37))
{
_root.xy = _root.getvv(1,_root.llevel);
_root.bg_mc.man._x += _root.xy.xx;
_root.bg_mc.man._y += _root.xy.yy;
_root.bg_mc.man._xscale = - Math.abs(_root.bg_mc.man._xscale);
if(_root.zt != "walk")
{
_root.bg_mc.man.gotoAndPlay("奔跑");
_root.zt = "walk";
}
}
else
{
_root.bg_mc.man.gotoAndStop("stand");
_root.zt = "stand";
}
}
if(_root.bxx >= _root.fx && _root.bg_mc._x > 600 - _root.bg_mc._width + 20)
{
_root.bg_mc._x += _root.fx - _root.bxx;
}
if(_root.bxx <= _root.bx && _root.bg_mc._x < -10)
{
_root.bg_mc._x += _root.bx - _root.bxx;
}
_root.bg_mc.tiao();
_root.af(_root.lr,_root.ddi);
if(Key.isDown(192))
{
System.setClipboard(_root.txt1.text);
}
if(Key.isDown(65))
{
_root.setb = "add";
}
if(Key.isDown(68))
{
_root.setb = "del";
}
if(Key.isDown(66))
{
_root.setb = "bian";
}
if(Key.isDown(83))
{
_root.setb = "set";
}
var _loc2_ = 1;
while(_loc2_ <= 8)
{
if(_loc2_ <= _root.life)
{
_root["xin" + _loc2_]._alpha = 100;
}
else
{
_root["xin" + _loc2_]._alpha = 0;
}
_loc2_ = _loc2_ + 1;
}
if(_root.scoretxt < _root.score)
{
if(_root.scoretxt - _root.score > -4)
{
_root.scoretxt = _root.score;
}
else
{
_root.scoretxt += 4;
}
}
if(_root.scoretxt > _root.score)
{
if(_root.scoretxt - _root.score < 4)
{
_root.scoretxt = _root.score;
}
else
{
_root.scoretxt -= 4;
}
}
if(_root.timeC == 0 && _root.win == 0)
{
_root.timeC = getTimer();
}
_root.timeF();
if(_root.win == 0 && Math.abs(_root.bg_mc.man._x - zhu_array[_root.level][_root.winat[_root.level]][0]) <= 5 && Math.abs(_root.bg_mc.man._y - zhu_array[_root.level][_root.winat[_root.level]][1]) <= 5)
{
_root.win = 1;
delete _root.onEnterFrame;
}
};
if(_root.debug == 1)
{
_root.bg_mc.onMouseDown = function()
{
if(_root.setb == "add")
{
var _loc3_ = _root.bg_mc._xmouse;
var _loc2_ = _root.bg_mc._ymouse;
_root.bg_mc.attachMovie("tt","tt" + _root.ttn,_root.bg_mc.getNextHighestDepth(),{_x:_loc3_,_y:_loc2_,ii:_root.ttn});
_root.setb = "";
_root.ttn = _root.ttn + 1;
_root.zhu_array[_root.level].push([_loc3_,_loc2_,1,0]);
_root.showA();
}
};
}